import React, {useState}  from 'react';
import {TopContainer} from "./Top.css";
import SearchBar from "./SearchBar";
import {Mask} from "../../../../components/Mask";
import Identification from "../../../Identification";

import {useDispatch, useSelector} from 'react-redux';

function Top(props) {

    // useEffect(()=>{
    //     let mask = Mask({
    //         element:<div>233hahhh33</div>,
    //     })
    // },[])
    // let [IdentMask, setIdentMask]  = useState(null);
    const user = useSelector(state => state.userReducer.user);

    return (
        <TopContainer>
            <SearchBar/>
            <div>
                {
                    user
                    ?
                    (
                    <div>
                        okok
                    </div>)
                    :
                    (<button onClick={()=>{
                        // setIdentMask(Mask({element:<Identification/>}))
                        
                        Mask({element:<Identification/>})
                    }}>登录</button>)
                }
                
            </div>

        </TopContainer>
    );

}



export default Top;